<template>
  <div>
    <el-container>
      <el-container>
        <el-aside width="280px">
          <UserType :tableData="tableData" />
        </el-aside>
        <el-main style="padding-top: 0">
          <Role :userTypeData="tableData" />
        </el-main>
      </el-container>
    </el-container>
    <UserTypeAdd :tableData="tableData" />
  </div>
</template>
<script>
import { tbDictDetailQuery } from '@/api/admin/system/dictionaryDet.js'
export default {
  components: {
    UserType: () => import('./UserType.vue'),
    Role: () => import('./Role.vue'),
    UserTypeAdd: () => import('./UserTypeAdd.vue'),
  },
  data() {
    return {
      listQuery: {
        dictId: '0c64ee4896364b6f8bc3314e768ae676',
        page: 1,
        limit: 999,
      },
      tableData: [],
    }
  },
  mounted() {
    this.getList()
    this.$bus.$on('refreshUserTypeList', this.getList)
  },
  beforeDestroy() {
    this.$bus.$off('refreshUserTypeList')
  },
  methods: {
    //查询用户类型
    getList() {
      tbDictDetailQuery(this.listQuery).then((res) => {
        this.tableData = res.data.data
      })
    },
  },
}
</script>
<style scoped lang="scss">
</style>